package IC.lir.instructions;
import IC.lir.operands.*;
import IC.lir.*;

/**
 * MoveField instruction (store):
 * 
 * MoveField Op1, Op2
 * 
 * Op1: Reg, Immediate
 * Op2: Reg.Reg, Reg.Immediate
 *
 */
public class MoveToFieldInstr extends MoveFieldInstr {
	private Operand 	source;

	/**
	 * Create a MoveField store instruction
	 * @param object 
	 * @param field
	 * @param dest
	 */
	public MoveToFieldInstr(Operand source, RegOperand instance, Operand field) {
		super(instance,field);
		assert(source instanceof RegOperand || source instanceof ImmOperand || source instanceof Label);
		this.source = source;
	}

	/**
	 * @return the dest
	 */
	public Operand getSource() {
		return source;
	}

	@Override
	public <D,U> U accept(Visitor<D,U> v, D context) {
		return v.visit(this,context);
	}
}
